use xiaohao_ar::sliding_window_ar::*;

// 1.
#[test]
fn max_sliding_window_test() {
    let v1 = vec![1, 3, -1, -3, 5, 3, 6, 7];
    assert_eq!(vec![3, 3, 5, 5, 6, 7], max_sliding_window(v1, 3));
}

// 2.
#[test]
fn length_of_longest_substring_test() {
    let s = "abcabcbb";
    assert_eq!(3, length_of_longest_substring(s));
}
// 2.1
#[test]
fn length_of_longest_substring_hashmap_test() {
    let s = "abcabcbb";
    assert_eq!(3, length_of_longest_substring_hashmap(s));
}
// 2.2
#[test]
fn length_of_longest_substring_vec_test() {
    let s = "abcabcbb";
    assert_eq!(3, length_of_longest_substring_vec(s));
}

// 3.
#[test]
fn find_anagrams_test() {
    let s = "cbaebabacd";
    let p = "abc";
    assert_eq!(vec![0, 6], find_anagrams(s, p));
}
